package librus.view
{
	import mx.containers.Canvas;
	import mx.controls.ProgressBar;
	import mx.core.UIComponent;
	
	public class ProgressBox extends UIComponent
	{
		public function ProgressBox(source:Object)
		{
			super();
			__source = source;
		}
		
		private var __progress:ProgressBar;
		private var __source:Object;
		
		override protected function createChildren():void
		{
			super.createChildren();
			
			__progress = new ProgressBar;
			__progress.source = __source;
			__progress.width = 200;
			__progress.height = 100;
			
			addChild(__progress);
		}
		
		override protected function updateDisplayList(unscaledWidth:Number, unscaledHeight:Number):void
		{
			super.updateDisplayList(unscaledWidth, unscaledHeight);
			
			__progress.x = (unscaledWidth - __progress.width)/2;
			__progress.y = (unscaledHeight - __progress.height)/2;
			
//			graphics.clear();
//			graphics.beginFill(0xff0000);
//			graphics.drawRect(0,0,unscaledWidth,unscaledHeight);
//			graphics.endFill();
		}
	}
}